
/*package com.hy.enterprise.framework.jpa.core.entity ;

import java.io.Serializable ;

import javax.persistence.Column ;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id ;
import javax.persistence.MappedSuperclass ;

import org.apache.commons.lang.builder.CompareToBuilder ;
import org.apache.commons.lang.builder.EqualsBuilder ;
import org.apache.commons.lang.builder.HashCodeBuilder ;
import org.apache.commons.lang.builder.ToStringBuilder ;
import org.apache.commons.lang.builder.ToStringStyle ;
import org.hibernate.annotations.Index ;

import com.hy.enterprise.framework.jpa.core.entity.identifier.IntegerIdentifier;
import com.hy.enterprise.framework.jpa.core.entity.util.StringIdentifier;

*//**
 * 
 * 
 * <ul>
 * <li>开发作者：花宏宇</li>
 * <li>设计日期：2012-6-10；时间：上午09:22:31</li>
 * <li>类型名称：IntAbstractPersistentEntity</li>
 * <li>设计目的：持久化数据模型抽象实现类（ 包含一些实体类的通用属性，重写了hashCode和equals方法，这些属性可以被实体类，映射到数据库中）<br>
 * 实体类，应该继承此类
 * 注：集成StringIdentifier类，使实体类的主键为字符串类型
 * </li>
 * </ul>
 * <ul>
 * <b>修订编号：</b>
 * <li>修订日期：</li>
 * <li>修订作者：</li>
 * <li>修订原因：</li>
 * <li>修订内容：</li>
 * </ul>
 *//*
@ SuppressWarnings ( "unchecked" )
@ MappedSuperclass
public class IntAbstractPersistentEntity  extends IntegerIdentifier // implements Persistable <Integer,String>,
implements Comparable ,Cloneable , Serializable
{
	private static final long	serialVersionUID	=
	                                                  7750384559204769902L ;

	*//**
	 * 乐观锁版本字段
	 *//*
	private Integer	          entityVersion ;

	*//**
	 * 持久化标识符
	 *//*
	private Integer	          identifier ;
	private int	          id ;

	*//**
	 * 构造函数
	 *//*
	public IntAbstractPersistentEntity ( )
	{
		super ( ) ;
	}

	*//**
	 * 构造函数
	 * 
	 * @param identifier
	 *//*
	public IntAbstractPersistentEntity (
			Integer identifier )
	{
		super ( ) ;
		this.identifier =
		                  identifier ;
	}

	*//**
	 * @see java.lang.Object#clone()
	 *//*
	@ Override
	protected Object clone ( )
	                          throws CloneNotSupportedException
	{
		IntAbstractPersistentEntity clone =
		                                 IntAbstractPersistentEntity.class
		                                                               .cast ( super
		                                                                            .clone ( ) ) ;
		clone.identifier =
		                   null ;
		return clone ;
	}

	*//**
	 * @see java.lang.Comparable#compareTo(java.lang.Object)
	 *//*
	@ Override
	public int compareTo (
	                       Object other )
	{
		return CompareToBuilder
		                       .reflectionCompare (
		                                            this ,
		                                            other ) ;
	}

	@ Override
	public boolean equals (
	                        Object other )
	{
		if (null == other) {
			return false;
		} else {
			return EqualsBuilder.reflectionEquals(this, other);
		}
		 if (other == null) { return false; }
		   if (other == this) { return true; }
		   if (other.getClass() != getClass()) {
		     return false;
		   }
		   IntAbstractPersistentEntity rhs = (IntAbstractPersistentEntity) other;
		   return new EqualsBuilder()
		                 .appendSuper(super.equals(other))
		                 .append(id, rhs.id)
		                 .append(entityVersion, rhs.entityVersion)
		                 .isEquals();

	}

	*//**
	 * <ul>
	 * <li>设计作者：刘川</li>
	 * <li>设计日期：2009-8-14</li>
	 * <li>设计时间：下午04:04:48</li>
	 * <li>设计目的：获取乐观锁版本字段</li>
	 * </ul>
	 * <ul>
	 * <b>修订历史</b>
	 * <li>1、</li>
	 * </ul>
	 * 
	 * @return
	 *//*
	public Integer getEntityVersion ( )
	{
		return this.entityVersion ;
	}


	*//**
	 * @see java.lang.Object#hashCode()
	 *//*
	@ Override
	public int hashCode ( )
	{
//		return HashCodeBuilder.reflectionHashCode ( this ) ;
		return new HashCodeBuilder(17, 37).append(id).append(entityVersion).toHashCode();

	}

	*//**
	 * <ul>
	 * <li>设计作者：刘川</li>
	 * <li>设计日期：2009-8-14</li>
	 * <li>设计时间：下午04:04:05</li>
	 * <li>设计目的：设置乐观锁版本字段</li>
	 * </ul>
	 * <ul>
	 * <b>修订历史</b>
	 * <li>1、</li>
	 * </ul>
	 * 
	 * @param entityVersion
	 *//*
	public void setEntityVersion (
	                               Integer entityVersion )
	{
		this.entityVersion =
		                     entityVersion ;
	}
	*//**
	 * @see com.hy.enterprise.framework.jpa.core.entity.util.Identifierable#getIdentifier()
	 *//*
	@ Override
	public Integer getIdentifier ( )
	{
		return this.identifier ;
	}

	*//**
	 * @see com.hy.enterprise.framework.jpa.core.entity.util.Identifierable#setIdentifier(java.io.Serializable)
	 *//*
	@ Override
	public void setIdentifier (
			Integer identifier )
	{
		this.identifier =
		                  identifier ;
//		this.id=identifier;
	}

	*//**
	 * @see java.lang.Object#toString()
	 *//*
	@ Override
	public String toString ( )
	{
		return ToStringBuilder
		                      .reflectionToString (
		                                            this ,
		                                            ToStringStyle.MULTI_LINE_STYLE ) ;
	}
	
	
	@ Id
	@GeneratedValue
	@ Column ( name = "id" , unique = true , nullable = false )
//	@ Column ( name = "identifier" , length = 36 , unique = true , nullable = false )
	//@ Index ( name = "identifierIndex" )
	@Override
	public Integer getId() {
		// TODO Auto-generated method stub
		return id;
	}

	@Override
	public void setId(Integer id) {
		this.id=id;
//		this.identifier=id;
		
	}

	
	
}*/
